<template>

  <div>
    <el-container>
<!--   侧边栏   -->
<!--  菜单高亮颜色： #1890ff
      一级菜单颜色： #001529
      二级菜单颜色： #000c17   -->
      <el-aside :width="asideWidth" style="min-height: 100vh; background-color: #001529">
        <!--:width   侧边栏长度
            min-height: 100vh  100vh相当于整个窗口高度这么高  -->
        <div style="height: 60px; line-height: 6px; color: white;
         display: flex; align-items: center; justify-content: center">
          <img src="@/assets/logo1.png" alt="" style="width: 40px; height: 40px">
          <span class="logo-title" style="margin-left: 5px; font-size: 20px" v-show="!isCollapse">honey2024</span>
        </div>

        <el-menu :collapse="isCollapse" :collapse-transition="false" router background-color="#001529" text-color="rgba(255,255,255,0.65)" active-text-color="#fff"
                 style="border: none" :default-active="$route.path">
          <!--:collapse="" 是否水平收齐折叠菜单
              :collapse-transition="false" 去掉默认动画
              router 可以点击
              background-color 设置el-menu中的背景色    text-color 字体颜色    active-text-color 高亮时字体的颜色
              style:
              border: none  没有边框；
              default-active 当前激活菜单的index    $route.path 当前浏览器正在访问的路由  -->
          <el-menu-item index="/">
            <i class="el-icon-house"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/1">
            <i class="el-icon-house"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-menu-item index="/2">
            <i class="el-icon-house"></i>
            <span slot="title">系统首页</span>
          </el-menu-item>
          <el-submenu>
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>信息管理</span>
            </template>
            <el-menu-item>用户信息</el-menu-item>
            <el-menu-item>系统首页</el-menu-item>
            <el-menu-item index="/">管理员信息</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>



      <el-container>

        <!--   头部区域   -->
        <el-header>

          <i :class="collapseIcon" style="width: 40px; font-size: 26px" @click="handleCollapse"></i>

          <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-left: 20px">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item :to="{ path: '/user' }">用户管理</el-breadcrumb-item>
          </el-breadcrumb>

          <div style="flex: 1; width: 0; display: flex; align-items: center; justify-content: flex-end">
          <!-- justify-content: flex-end 靠右 -->
            <i class="el-icon-quanping" style="font-size: 26px; " @click="handleFull"></i>
            <!--      下拉菜单      -->
            <el-dropdown placement="bottom"><!-- placement="bottom" 靠中间 -->
              <div style="display: flex; align-items: center; coursor: default" >
                <img src="@/assets/logo1.png" alt="" style="width: 40px; height: 40px; margin: 0 5px">
                <spen>管理员</spen>
              </div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人信息</el-dropdown-item>
                <el-dropdown-item>修改密码</el-dropdown-item>
                <el-dropdown-item @click="">退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>

        </el-header>

        <!--   主体区域   -->
        <el-main>
          <div style="box-shadow: 0 0 10px rgba(0,0,0,.1); padding: 10px 20px; border-radius: 5px; margin-bottom: 10px">
            早安，骚年，祝你开心每一天！
          </div>
          <el-card style="width: 500px">
            <div slot="header" class="clearfix">
              <span>青哥哥带你做毕设2024</span>
            </div>
            <div>
              2024毕设正式开始了！青哥哥带你手把手敲出来！
              <div style="margin-top: 20px">
                <div style="margin: 10px 0"><strong>主题色</strong></div>
                <el-button type="primary">按钮</el-button>
                <el-button type="success">按钮</el-button>
                <el-button type="warning">按钮</el-button>
                <el-button type="danger">按钮</el-button>
                <el-button type="info">按钮</el-button>
              </div>
            </div>
          </el-card>
        </el-main>
      </el-container>

    </el-container>



  </div>

</template>


<script>

export default {
  name: 'HomeView',
  data() {
    return {
      isCollapse: false,    //collapsed 为false时不收缩
      asideWidth: '200px',   //展开侧边栏时侧边栏长度
      collapseIcon: 'el-icon-s-fold',  //头部展开时的图标
    }
  },
  methods: {
    handleCollapse(){
      //菜单栏展开收缩按钮
      //isCollapse默认为false，当isCollapse为false（不收缩）时变为true（收缩）
      this.isCollapse = !this.isCollapse
      //isCollapse为收缩时（true）asideWidth.width=64px，为展开时（false）为200px
      this.asideWidth = this.isCollapse ? '64px' : '200px'
      this.collapseIcon = this.isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'
    },
    handleFull(){
      // 全屏事件
      document.documentElement.requestFullscreen()
    }
  }
}

</script>

<style>

.el-menu--inline {
  background-color: #000c17 !important;
}
.el-menu--inline .el-menu-item{
  background-color: #000c17 !important;
  padding-left: 49px !important;
}

/*hover 鼠标选中时的效果*/
.el-menu-item:hover, .el-submenu__title:hover{
  color: #fff !important;
}
.el-submenu__title:hover i{
  /*当.el-submenu__title:hover的时候i变*/
  color: #fff !important;
}

/*is-active 处于活动状态(该项的index为当前页面index时）*/
.el-menu-item.is-active{
  background-color: #1890ff !important;
  border-radius: 5px !important;
  width: calc(100% - 8px);
  margin-left: 4px;
}
.el-menu-item.is-active .el-tooltip{
  margin-left: -4px;
}


.el-menu-item.is-active i{
  margin-left: -4px;
}

.el-menu-item {
  /*一级菜单*/
  height: 40px !important;
  line-height: 40px !important;
}
.el-submenu__title {
  /*二级菜单*/
  height: 40px !important;
  line-height: 40px !important;
}

.el-submenu .el-menu-item{
  min-width: 0;
}

.el-submenu__icon-arrow{
  /*二级菜单的向下箭头*/
  margin-top: -5px;
}

.el-menu--inline .el-menu-item.is-active{
  padding-left: 45px !important;
}

.el-aside{
  /*设置收缩动画*/
  transition: width .3s;
  /*阴影*/
  box-shadow: 2px 0 6px rgba(0,21,41,.35);
}

.logo-title {
  margin-left: 5px; font-size: 20px;
  /*动画*/
  transition: all .3s;    /*0.3简写*/
}

/*头部*/

.el-header {
  /*header默认高度60px*/
  box-shadow: 2px 0 6px rgba(0,21,41,.35);
  display: flex;
  align-items: center;
}
</style>